package jdk5.common;

import java.util.Date;
import java.io.Serializable;

public class Student implements Serializable {
	private Integer id;
	private String name;
	private String sex;
	private Date birthday;

	public Student() {
	}

	public Student(String name, String sex, Date birthday) {
		this.name = name;
		this.sex = sex;
		this.birthday = birthday;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getSex() {
		return sex;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Date getBirthday() {
		return birthday;
	}

	@Override
	public boolean equals(Object o) {
		if (!(o instanceof Student))
			return false;

		Student s = (Student) o;
		return id.equals(s.id) && name.equals(s.name) && sex.equals(s.sex)
				&& birthday.equals(birthday);
	}

	@Override
	public int hashCode() {
		return (name + sex + birthday.toString()).hashCode();
	}
}